home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10912 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  830 b 

  1. Path: inforamp.net!ts31-02
  2. From: rmorin@inforamp.net (Randy Charles Morin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Major problem with strings.
  5. Date: Mon, 11 Mar 96 06:20:01 GMT
  6. Organization: MiddleWorld SoftWare
  7. Message-ID: <4i0gn0$5g9@sam.inforamp.net>
  8. References: <31438275.72DB@aol2.com>
  9. NNTP-Posting-Host: ts31-02.tor.inforamp.net
  10. X-Newsreader: News Xpress Version 1.0 Beta #4
  11.  
  12. In article <31438275.72DB@aol2.com>, Neil <neil@aol2.com> wrote:
  13. >1    char *club="";
  14. >2    club="/public_html/neil";
  15. >3    strcat(club,argv[1]+5);
  16. >4    strcat(club,"/");
  17.  
  18. No, this just won't do.  When you want a '/' slash in C, use two slashes.  The 
  19. '/' is also used to denote an escape sequence (for special characters).  Thus 
  20. your code should read...
  21.  
  22. 1    char *club="";
  23. 2    club="//public_html//neil";
  24. 3    strcat(club,argv[1]+5);
  25. 4    strcat(club,"//");
  26.  
  27. Agrivar
  28.